如何在回归克里金法中拟合gstat模型?

时间:2016-01-01 09:36:51

标签: r glm kriging gstat

我正在尝试使用r gstat包使用回归克里金来拟合模型。我已经加载了一些名为流行病和一些协变量降雨的疾病数据。降雨栅格数据作为.grd文件加载。我用来适应此模型的代码是

import subprocess
import requests
import shutil
import glob
import json

audio = requests.get('http://somesite.com/some.mp3')
sox = shutil.which('sox') or glob.glob('C:\Program Files*\sox*\sox.exe')[0]
p = subprocess.Popen(sox + ' -t mp3 - -t flac - rate 16k', stdin = subprocess.PIPE, stdout = subprocess.PIPE, shell = True)
stdout, stderr = p.communicate(audio.content)
url = 'http://www.google.com/speech-api/v2/recognize?client=chromium&lang=en-US&key=AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw'
headers = {'Content-Type': 'audio/x-flac; rate=16000'}
response = requests.post(url, data = stdout, headers = headers).text

result = None
for line in response.split('\n'):
    try:
        result = json.loads(line)['result'][0]['alternative'][0]['transcript']
        break
    except:
        pass

我得到的错误结果是

m = fit.gstatModel(prevalence, Prevalence~rainfall,rainfall, family = poisson())

有人可以帮忙吗?

0 个答案:

没有答案