- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个数据框df
df<-structure(list(ID = structure(c(1L, 3L, 5L, 6L, 8L, 9L, 10L,
11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L,
24L, 28L, 29L, 30L, 33L, 34L, 37L, 38L, 40L, 41L, 42L, 43L, 44L,
45L, 46L, 48L, 49L, 50L, 52L, 53L, 54L, 56L, 57L, 60L, 61L, 62L,
63L, 64L, 65L, 66L, 67L, 69L, 71L, 74L, 75L, 86L, 88L, 90L, 92L,
94L, 95L, 100L, 101L, 107L, 108L, 109L, 110L, 111L, 112L), .Label = c("AU-Tum",
"AU-Wac", "BE-Bra", "BE-Jal", "BE-Vie", "BR-Cax", "BR-Sa3", "CA-Ca1",
"CA-Ca2", "CA-Ca3", "CA-Gro", "Ca-Man", "CA-NS1", "CA-NS2", "CA-NS3",
"CA-NS4", "CA-NS5", "CA-NS6", "CA-NS7", "CA-Oas", "CA-Obs", "CA-Ojp",
"CA-Qcu", "CA-Qfo", "CA-SF1", "CA-SF2", "CA-SF3", "CA-SJ1", "CA-SJ2",
"CA-SJ3", "CA-TP1", "CA-TP2", "CA-TP4", "CN-Cha", "CN-Ku1", "CZ-Bk1",
"De-Bay", "DE-Hai", "DE-Har", "DE-Tha", "DE-Wet", "DK-Sor", "ES-Es1",
"FI-Hyy", "FI-Sod", "FR-Fon", "FR-Hes", "FR-Lbr", "FR-Pue", "GF-Guy",
"ID-Pag", "IL-Yat", "IT-Col", "IT-Cpz", "IT-Lav", "IT-Non", "IT-Pt1",
"IT-Ro1", "IT-Ro2", "IT-Sro", "JP-Tak", "JP-Tef", "JP-Tom", "NL-Loo",
"PT-Esp", "RU-Fyo", "RU-Zot", "SE-Abi", "SE-Fla", "SE-Nor", "SE-Sk1",
"SE-Sk2", "SE-St1", "UK-Gri", "UK-Ham", "US-Bar", "US-Blo", "US-Bn1",
"US-Bn2", "Us-Bn3", "US-Dk3", "US-Fmf", "US-Fwf", "US-Ha1", "US-Ha2",
"US-Ho1", "US-Ho2", "US-Lph", "US-Me1", "US-Me3", "US-Nc2", "US-NR1",
"US-Oho", "US-So2", "US-So3", "US-Sp1", "US-Sp2", "US-Sp3", "US-Syv",
"US-Umb", "US-Wcr", "US-Wi0", "US-Wi1", "US-Wi2", "US-Wi4", "US-Wi8",
"VU-Coc", "CA-Cbo", "RU-Ab", "RU-Be", "RU-Mix", "TH-Mae"), class = "factor"),
VarA = c(98.5, 77, 63.2222222222222, 97, 52.5, 3.5, 15.5,
71, 161.833333333333, 153.5, 73, 39, 40, 23, 14, 5.5, 78,
129.5, 73.5, 4, 100, 10, 3, 30, 65.5, 198, 45.5, 20, 111.5,
44, 68.5, 102.5, 39.1111111111111, 83.8, 136, 31.5, 56.5,
101, 39.25, 108.5, 52.1666666666667, 9.5, 13, 52.1428571428571,
66.5, 1, 44.25, 106, 19, 202.571428571429, 200, 36.6, 2,
21.2, 69, 135, 46.5, 17.5, 96, 80.6666666666667, 10.6666666666667,
86.5, 70.5, 19.5, 85, 200, 50, 250, 30.5), Y = c(436.783385497984,
55.1825021383702, 526.4133417369, 560, 391.49284084118, -519.814235572849,
11.5525291214872, 162.441016515717, 39.0395567645998, -70.4910326673707,
17.1155716306239, -106.326129257097, -94.9308303585276, -66.4285516217351,
-144.929052323413, -220.613145695315, 157.129576861289, 44.1257786633602,
46.8326830295943, -146.719591499443, 30.8043649939355, -4.10548956954153,
-108.258462657337, 90.3369144331664, 126.866108251153, 42.9489971246803,
-45.4886732113082, 483.932040393885, 590.754048774834, 82.1480000555981,
76.8863707484328, 404.007940533033, 202.629066249886, -46.9675149230141,
557.939170770813, 300.979565786038, 224.256197650044, 148.719307398695,
201.195892312115, 466.727302447427, 552.762670615377, 481.359543363331,
467.379381521489, 444.812610935212, 308.198167469197, -638.973101716489,
321.395064735785, 181.896345832773, 629.214319321327, -176.181996958815,
214, 59.1716887350485, -186.42650026083, 515.533437888983,
595.091753601562, 255.499246957091, 368.347069109092, 141.97570288631,
39.5917358684237, 105.039591642989, 77.9087587283187, 153.700042322307,
198.276033313996, 358.242634316906, 156.666666666667, 270,
247, 100, -10)), .Names = c("ID", "VarA", "Y"), row.names = c(NA,
-69L), class = "data.frame")
我正在执行非线性回归分析以拟合模型的参数。
library (minpack.lm)
fit1<- nlsLM(Y~A*(1-exp(k*VarA)), data = NEP_Mean_Site,
start = list(A=192.93829, k=-0.08976), control = list(maxiter = 500))
当我根据我的数据绘制非线性模型的输出时,我得到了这个输出。
coeff(fit1)
f<- function (x) {211.00044*(1-exp(-0.07224*x))}
plot(df$VarA, df$Y)
curve(f, add=T)
但是,我希望我的模型从零开始。我想我必须调整我的模型并在我的 nls 拟合中包含一个偏移量,但找不到如何做的方法。任何人都知道该怎么做?
最佳答案
只需将偏移量添加到公式中:
fit1<- nlsLM(Y~offset + A*(1-exp(k*VarA)),
data = df,
start = list(offset = -300, A=192.93829, k=-0.08976),
control = list(maxiter = 500))
要绘制函数,您可以使用稍微更通用的代码。这样你就不必每次有不同的拟合时都手动构造一个函数:
plot(Y~ VarA, data = df)
id <- order(df$VarA)
lines(predict(fit1)[id] ~ df$VarA[id])
给你:
关于r - 在适合 R 的 nls 中添加偏移量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35477794/
我正在尝试从第 4 到 9 页以及第 12 和 13 页上的单元格中清除所有内容(包括图像)。我有以下代码,但它正在清除第 3-9 和 12-15 页中的内容,我不知道为什么。 有什么想法吗? Sub
有没有办法增加极坐标图刻度标签(θ)的填充/偏移? import matplotlib import numpy as np from matplotlib.pyplot import figure,
我正在调用本地 API 并尝试以分页 样式进行操作。我有 n 张图片,我想将它们分成 n/4 行(每行 4 张图片)。因此,我正在调用我的 API,images/count,offset。但不知何故,
我的问题解释起来有点棘手,但无论如何我都会尝试。我有两个水平选项卡,当您单击它们时,会打开一个文本框内容。当他们被点击时,我试图“关注”他们。我在网上找到了很多资料,但除了我在下面显示的这段代码外,没
所以我有一个 float 的 div,我需要它始终向右 200 像素,并填充窗口的其余部分。有没有某种跨浏览器兼容的方法,我可以在不借助 javascript 的情况下使宽度填满页面的其余部分? 最佳
我有以下片段 $('html,body').animate({scrollTop: $('#menu').offset().top}, 'slow'); 单击链接时,我希望浏览器从#menu div
我目前正在为我的应用程序使用 JASidePanel,并且我有一个 UITableViewcontroller 和一个 UIRefreshControl 作为它的 ViewController 之一。
给出以下代码: imshow(np.arange(16*16).reshape(16,16)) cb = colorbar() cb.set_label("Foo") cb.set_ticks([0,
我是编程新手,我认为 VBA 是一个很好的起点,因为我在 Excel 中做了很多工作。 我创建了一个宏,它从输入框中获取一个整数(我一直使用 2、3 和 4 来测试),并创建该数字的一组 4 层层次结
我在 PHP 中有一个 unix 时间戳: $timestamp = 1346300336; 然后我有一个我想要应用的时区的偏移量。基本上,我想应用偏移量并返回一个新的 unix 时间戳。偏移量遵循这
演示:http://jsfiddle.net/H45uY/6/ 我在这里想做的是将 的左上角设为跟随鼠标。代码在没有段落的情况下工作正常(请参阅上面的演示),但是当您添加段落时,被向上推,鼠标位于盒
假设我们有两个由无符号长(64 位)数组表示的位图。我想使用特定的移位(偏移)合并这两个位图。例如,将位图 1(较大)合并到位图 2(较小)中,起始偏移量为 3。偏移量 3 表示位图 1 的第 3 位
通过在 pageViewController 中实现 tableView,tableView 与其显示的内容不一致。对此最好的解决办法是什么? 最佳答案 如果您的 TableView 是 View C
我设置了一个在 nib 中显示地点信息的地点配置文件。当我在标准屏幕流程中推送此 View 时,它工作正常。但是,当我从另一个选项卡推送此 View 时,UINavigationBar 似乎抵消了它,
如果我想选择 5 条记录,我会这样做: SELECT * FROM mytable LIMIT 5 如果我想添加偏移量,我会这样做: SELECT * FROM mytable OFFSET 5 LI
我有一个应用程序,其中某些 View 需要全屏,而其他 View 不需要全屏。在某些情况下,我希望背景显示在状态栏下方,所以我在 View 加载时使用它来使 Activity 全屏显示: window
在下图中,我进行绘制,结果位于 A 点,就在我手指接触的地方。 如何使图像显示在实际触摸上方约 40pt。 (二) 我正在使用经典的 coreGraphic UITouch 代码,如下所示: - (v
只要键盘处于事件状态,我就会尝试偏移 UITextField,效果很好,直到我尝试了表情符号布局。有没有办法检测键盘输入的类型,以便找出高度差?谢谢 最佳答案 不是使用 UIKeyboardDidSh
这是我的 Swift 代码 (AppDelegate.swift): var window: UIWindow? var rootViewController :UIViewController? f
我有一个 div 作为绝对定位的 body 的直接子节点,其 css 属性定义如下: div[id^="Container"] { display: block; position: a
我是一名优秀的程序员,十分优秀!